The present disclosure relates to computer-based color conversion for transforming an image from one color space representation to another, for example, transforming an image represented using a DeviceN color space or a separation color space to an alternative color space representation.
An image can be comprised of a plurality of individual picture elements, or pixels, arranged to convey a specific visual impression, such as the recreation of an object or a person. Further, all of the pixels included in an image can be associated with a particular palette, such as a palette comprised of gray-scale values (also referred to as “black and white”) and/or color values. Additionally, a pixel can be assigned a single value from the palette, such that the pixel represents a uniform color or shade within the image. In a gray-scale image, each pixel is assigned a value that corresponds to a shade falling within the range of black to white. Similarly, the values that can be assigned to the pixels of a color image are defined in accordance with the color model that is used.
A color model is a mathematical key that defines a specific color using a particular tuple of numbers. A three-tuple of numbers uses three separate color components to define the colors available in that color model. Each of the numbers comprising the three-tuple corresponds to a different color component. For example, a standard color model for the specification of a set of three colors is expressed using red, green, and blue (RGB). The RGB color model is commonly employed in connection with visual displays. The value of each color component in the RGB color model can range between 0 and 255, and can be expressed as an eight-bit binary number. Thus, the RGB color model provides for 16,777,216 unique colors. For example, the color blue can defined by the values red=0, green=0, blue=255. A variation of the color blue, however, can be defined by the values red=1, green=0, blue=255.
Similarly, in a four-tuple color model, each number comprising the four-tuple provides the value of a separate color component. One common four-tuple color model includes the color components cyan, magenta, yellow, and black (CMYK). In one implementation, the CMYK color model is used to describe the different inks needed to generate a given color when light is reflected from a white substrate, such as paper, on which the inks have been applied. Therefore, the CMYK color model is often referenced in association with printing applications. The CMYK color model also can be expanded through the addition of one or more other color components (or “spot colors”) to permit the definition of custom colors.
As described above with respect to RGB, a color model also can be associated with a precise definition of how the color components are to be interpreted. The definition can be applied to any valid tuple to derive the corresponding color in that color model, such as a particular shade of blue. In forming the definition, each valid tuple that can be used to define a unique color in the color model is mapped to a set of available colors. The set of available colors can be selected such that there are at least as many discrete colors as the number of unique tuples that can be expressed using the color model. Thus, every unique value that can be represented using the tuples of the color model can correspond to a separate color or shade. The totality of colors or shades that can be represented using the unique values of a particular color model is referred to as the gamut of that color model. As the number of unique tuples that can be expressed using the color model increases, the range and/or depth of the color space also can be increased.
Additionally, a color conversion can be performed to transform an image from one color space representation to another. For example, an image can be stored in an electronic file using the hue, saturation, value (HSV) color space. An associated display device, however, can be configured to support only the RGB color space. Thus, in order to present the image on the associated display device, the image can be converted from the HSV color space to the RGB color space. Similarly, an associated printer can be configured to support only the CMYK color model. Therefore, the image can be transformed into a CMYK representation prior to printing.
The source color space of the image and the destination color space of the transformed image can include one or more common colors. If the gamut of the source color space differs from the gamut of the destination color space, however, a mismatch can result for one or more pixels. Thus, during a color conversion, a best match is sought between the two color spaces. With some conversion techniques it is possible to preserve all of the color information as defined in the original image. These conversion techniques are therefore reversible. A portion of the color information associated with the original image is destroyed with other conversion techniques, however, and these techniques cannot be reversed.
A color conversion between color space representations can be performed mathematically. In performing the conversion, a pixel included in the image is selected and the value associated with that pixel is transformed from the source color space to the destination color space. For example, an algorithm comprising one or more equations can be used to map a color value expressed in the RGB color space to an equivalent CMYK color value. The numbers comprising the RGB-tuple can be entered into the equation and the resulting CMYK color value can be generated. The same algorithm can be used to transform the value associated with each pixel of the original image.
Performing one or more computations for each pixel of an image can result in a lengthy process. Thus, conversion tables have been generated in an attempt to decrease the time required to execute a color conversion. A conversion table maps the values of a source color space to equivalent or comparable values of at least one destination color space. Thus, during a color conversion, the tuple associated with a pixel of the image being transformed can be located in the conversion table and the transformed value can be identified without the need to solve one or more equations. Depending on the color model, however, a conversion table can be very large. For example, a conversion table for transforming an image represented using an RGB color model can have over 16.7 million entries. Further, it can be necessary to generate a plurality of conversion tables to account for the plurality of possible destination color spaces into which an image can be transformed.